Skip to content

docs: align TS SDK docs with post-FA APT patterns (aptos-ts-sdk #852)#404

Merged
gregnazario merged 2 commits intomainfrom
cursor/docs-style-consistency-e64d
Mar 20, 2026
Merged

docs: align TS SDK docs with post-FA APT patterns (aptos-ts-sdk #852)#404
gregnazario merged 2 commits intomainfrom
cursor/docs-style-consistency-e64d

Conversation

@gregnazario
Copy link
Collaborator

Summary

Mirrors the intent of aptos-ts-sdk#852: after the Fungible Asset migration, new accounts may not have legacy CoinStore<...AptosCoin>, so docs should use getAccountAPTAmount and 0x1::aptos_account::transfer for APT quickstarts and examples.

Changes

  • TS SDK Quickstart (EN + ZH): Replace getAccountResource + CoinStore balance reads with getAccountAPTAmount; add maxGasAmount: 100_000 on transaction.build.simple for typical devnet faucet limits; use TRANSFER_AMOUNT in the full example.
  • Fetch Data via SDK (EN + ZH): Lead with getAccountAPTAmount and FA migration note; generic typing example now uses 0x1::account::Account instead of CoinStore.
  • First transaction (EN): Aside text describes getAccountAPTAmount / balance APIs instead of CoinStore.
  • First transaction (ZH): TypeScript + Python snippets use aptos_account::transfer; drop unused TypeTag import.
  • Account abstraction (EN + ZH): Examples use aptos_account::transfer; fix invalid new aptos.transaction.build.simple in the complex guide (ZH + EN).

Testing

  • pnpm lint
  • pnpm format:content (pre-commit remark on staged MDX)
  • astro check (pre-push)

Notes

  • Spanish (es/) tree is not present in this repo; EN + ZH updated per project guidelines.
Open in Web Open in Cursor 

- Use getAccountAPTAmount instead of getAccountResource(CoinStore)
- Add maxGasAmount for devnet faucet compatibility
- Match aptos-ts-sdk PR #852 patterns (en + zh)
- Fetch Data: getAccountAPTAmount + generic getAccountResource example (en, zh)
- First transaction: correct balance-check notes; zh uses aptos_account::transfer
- Account abstraction: aptos_account::transfer; fix invalid new build.simple (en, zh)
@vercel
Copy link

vercel bot commented Mar 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
aptos-docs Ready Ready Preview, Comment Mar 20, 2026 3:33am

Request Review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Aptos docs (EN + ZH) to align TypeScript (and some Python) SDK examples with post–Fungible Asset migration patterns, avoiding reliance on legacy CoinStore<...AptosCoin> resources that may be absent for new accounts.

Changes:

  • Updated TS SDK quickstarts/examples to use getAccountAPTAmount for APT balances and 0x1::aptos_account::transfer for transfers.
  • Added options: { maxGasAmount: 100_000 } to TS transaction build examples to better fit common devnet faucet funding assumptions.
  • Refreshed account abstraction and first-transaction guides (EN + ZH) to use aptos_account::transfer, adjusted explanatory asides, and removed an unused Python import (ZH).

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/content/docs/build/sdks/ts-sdk/quickstart.mdx Switches balance reads to getAccountAPTAmount, updates transfer function, adds maxGasAmount option.
src/content/docs/zh/build/sdks/ts-sdk/quickstart.mdx Same as EN quickstart changes, localized.
src/content/docs/build/sdks/ts-sdk/fetch-data-via-sdk.mdx Adds FA-migration note, leads with getAccountAPTAmount, updates generic resource example to 0x1::account::Account.
src/content/docs/zh/build/sdks/ts-sdk/fetch-data-via-sdk.mdx Same as EN fetch-data changes, localized.
src/content/docs/build/sdks/ts-sdk/account/account-abstraction.mdx Updates transfer entry function to aptos_account::transfer and fixes an invalid new ...build.simple usage to await ...build.simple.
src/content/docs/zh/build/sdks/ts-sdk/account/account-abstraction.mdx Same as EN account-abstraction changes, localized.
src/content/docs/build/guides/first-transaction.mdx Updates asides to describe post-FA balance lookup behavior (TS + Python).
src/content/docs/zh/build/guides/first-transaction.mdx Updates TS/Python transfer examples to aptos_account::transfer and removes unused Python import.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

## Using Generic Queries

Some queries are intentionally broad, but this can make inferring the proper return type difficult. To accommodate that, these broad requests like `getAccountResources` allow you to specify what the expected response type should be.
Some queries are intentionally broad, but this can make inferring the proper return type difficult. To accommodate that, broad requests like `getAccountResources` allow you to specify what the expected response type should be when you use `getAccountResource`.
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wording here is internally inconsistent: it cites getAccountResources as the “broad request”, but then says you specify the expected type “when you use getAccountResource”. Since the example is getAccountResource<T>(...), consider rephrasing to describe getAccountResource (or show an example for getAccountResources) to avoid confusing readers about which API supports generic typing.

Suggested change
Some queries are intentionally broad, but this can make inferring the proper return type difficult. To accommodate that, broad requests like `getAccountResources` allow you to specify what the expected response type should be when you use `getAccountResource`.
Some queries are intentionally broad, but this can make inferring the proper return type difficult. To accommodate that, broad requests like `getAccountResource` allow you to specify the expected response type by using a generic type parameter.

Copilot uses AI. Check for mistakes.
## 使用通用查询

某些查询设计上是宽泛的,但这可能使得推断正确的返回类型变得困难.为了适应这种情况,像 `getAccountResources` 这样的广泛请求允许你指定预期的响应类型.
某些查询设计上是宽泛的,但这可能使得推断正确的返回类型变得困难.为了适应这种情况,像 `getAccountResources` 这样的广泛请求允许你在使用 `getAccountResource` 时指定预期的响应类型.
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence mixes getAccountResources and getAccountResource in a way that’s confusing: it says broad requests like getAccountResources let you specify the expected type “when using getAccountResource”. Since the snippet uses getAccountResource<T>(...), consider rewriting to directly explain getAccountResource’s generic type parameter (or add a separate example for getAccountResources).

Suggested change
某些查询设计上是宽泛的,但这可能使得推断正确的返回类型变得困难.为了适应这种情况,像 `getAccountResources` 这样的广泛请求允许你在使用 `getAccountResource` 时指定预期的响应类型.
某些查询在设计上是宽泛的,但这可能使得推断正确的返回类型变得困难.为了解决这一问题,你可以在调用 `getAccountResource<T>` 时通过泛型类型参数 `T` 明确指定预期的响应类型,从而让 TypeScript 正确推断返回值.

Copilot uses AI. Check for mistakes.
function: "0x1::aptos_account::transfer",
functionArguments: [bob.accountAddress, 100],
},
// Lower default gas fits typical devnet faucet funding (1 APT)
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment implies maxGasAmount maps directly to an APT budget, but maxGasAmount is a gas unit cap; the maximum fee is maxGasAmount * gasUnitPrice (in octas). Consider adjusting the wording to avoid suggesting a direct “1 APT” equivalence, or mention the fee formula to prevent misunderstandings.

Suggested change
// Lower default gas fits typical devnet faucet funding (1 APT)
// Gas unit cap suitable for typical devnet faucet funding (for example, 1 APT);
// actual max fee paid is maxGasAmount * gasUnitPrice (in octas)

Copilot uses AI. Check for mistakes.
function: "0x1::aptos_account::transfer",
functionArguments: [bob.accountAddress, 100],
},
// 降低默认 gas 上限以适配常见 devnet 水龙头额度(1 APT)
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的注释把 maxGasAmount 和「1 APT」直接关联容易误导:maxGasAmount 是 gas 单位上限,最大手续费实际是 maxGasAmount * gasUnitPrice(octas)。建议改写注释,避免让读者误以为 maxGasAmount 直接表示 APT 额度,或补充手续费计算方式。

Suggested change
// 降低默认 gas 上限以适配常见 devnet 水龙头额度(1 APT
// 将默认 gas 上限设为 100_000 个 gas 单位。实际最高手续费为 maxGasAmount * gasUnitPrice(以 octa 计),请根据账户余额(例如 devnet 常见的 1 APT 水龙头额度)调整。

Copilot uses AI. Check for mistakes.
@gregnazario gregnazario merged commit b4beabe into main Mar 20, 2026
11 checks passed
@gregnazario gregnazario deleted the cursor/docs-style-consistency-e64d branch March 20, 2026 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants